//  Copyright (c) 2008  Yoong-ki Ahn & Youngjin Kim < mexif@googlegroups.com>
//  See the enclosed file COPYING for license information (MIT Licence).
//  If you did not receive this file,
//  see http://www.opensource.org/licenses/mit-license.php.

#ifndef __MEXIF_UTIL_H__
#define __MEXIF_UTIL_H__

#ifdef __cplusplus
extern "C"
{
#endif

#include "mexiflib.h"


/// Detect camera maker from MEXIF_EXIF_Make tag information
mexif_maker_t MEXIF_API mexif_which_maker( const void* data, unsigned int size );

/// Detect Model name from MEXIF_EXIF_Model tag information
/// The purpose of this function to find out several models having errors when parsing makernote.
/// Most of models return NORMAL.
mexif_model_t MEXIF_API mexif_which_model( int maker, const void* data, unsigned int size );

/// Does the given stream starts with "Exif\0\0"?
mexif_bool	MEXIF_API mexif_is_exif_marker_prefixed( const void* data, unsigned int size );

/// is given stream prefixed with "" ?
mexif_bool	MEXIF_API mexif_is_jfif_marker_prefixed( const void* data, unsigned int size );

/// @return true if given data is valid tiff header.
mexif_bool	MEXIF_API mexif_parse_tiff_header( const void* data, unsigned int size, mexif_tiffheader_t* header );


#ifdef _MEXIFLIB_INSIDE
mexif_uint32 __stdcall _mexif_get_u16( const unsigned char* pb, unsigned int offset, int bigEndian );
mexif_uint32 __stdcall _mexif_get_u32( const unsigned char* pb, unsigned int offset, int bigEndian );
#define _GetU16 _mexif_get_u16
#define _GetU32 _mexif_get_u32
#endif

#ifdef __cplusplus
}
#endif

#endif // __MEXIF_UTIL_H__
